<%
/**
 *  modify 个人信息修改
 * 
 * @author   牟景飞
 * @version v1.0
 * @date     2012-09-12
 * @since   JDK1.6
 */
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="at" uri="/WEB-INF/util_tag.tld"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title><s:text name="person.modify.title"></s:text></title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta content="no-cache" http-equiv="Pragma"/>
		<meta content="no-cache" http-equiv="Cache-Control"/>
		<meta content="0" http-equiv="Expires"/>
		<meta name="GENERATOR" content="MSHTML 8.00.6001.18854"/>
		<link rel="stylesheet" type="text/css" id="edit" href="<at:url css="edit.css"/>" />
		<link rel="stylesheet" type="text/css" id="list" href="<at:url css="list.css"/>" />	
		<!--<link rel="stylesheet" id="view" type="text/css" href="<at:url css="view.css"/>" />-->
		<link rel="stylesheet" type="text/css" id="banner" href="<at:url css="banner_button.css"/>" />
		<link rel="stylesheet" type="text/css" href="${rootPath}/Common/Js/validation-engine-2.2/css/validationEngine.jquery.css"/>
		<link rel="stylesheet" type="text/css" href="${rootPath}/Common/Js/validation-engine-2.2/css/template.css"/> 		
		<script type="text/javascript" src="${rootPath}/Common/Js/jquery.js"></script>
		<script type="text/javascript" src="${rootPath}/Common/Js/common.js"></script>
		<script type="text/javascript" src="${rootPath}/Common/Js/select.js"></script>
		<script type="text/javascript" id="edit" src="<at:url js="view.js"/>"></script>
		<script type="text/javascript" src="${rootPath}/Common/Js/My97DatePicker/WdatePicker.js" defer="defer"></script>
		<script type="text/javascript" src="${rootPath}/Common/Js/Upload/ajaxupload.js"></script>
		<script src="${rootPath}/Common/Js/validation-engine-2.2/languages/jquery.validationEngine-cn.js" type="text/javascript" charset="utf-8"></script>
        <script src="${rootPath}/Common/Js/validation-engine-2.2/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript" src="<at:url js="banner_button.js"/>"></script>
		<script type="text/javascript">	
			/**
			 * 更新操作 
			 */
			function update() {
				if($("#webForm").validationEngine('validate')){
					document.getElementById("webForm").submit();
					startRequest("Person!modify", opHandler, $("#webForm").serialize());
				}	
			}			
			/**
			 * 操作成功提示
			 */
			function opHandler(data, textStatus) {
				alert('<s:text name="js.common.success"></s:text>');
			}
			
			/**
			 * 照片上传操作 
			 */
			function init(){
				var upload = $('#uploadPhoto'), interval;
				new AjaxUpload(upload, {
					action: 'adjunct!upImage', 
					name: 'file',
					onSubmit : function(file, ext){
						// change button text, when user selects file			
						upload.text('<s:text name="js.common.uploadPhoto"></s:text>');
						// If you want to allow uploading only 1 file at time,
						// you can disable upload button
						this.disable();
						
						// Uploding -> Uploading. -> Uploading...
						interval = window.setInterval(function(){
							var text = upload.text();
							if (text.length < 10){
								upload.text(text + '.');					
							} else {
								upload.text('<s:text name="js.common.uploadPhoto"></s:text>');				
							}
						}, 200);
					},
					onComplete: function(file, response){
						var json = eval('(' + response + ')');
						window.clearInterval(interval);
						document.getElementById("photo").value = json.id;
						//$("#webForm").validate().element($("#photo"));
						document.getElementById("uploadPhoto").innerHTML = "<img width='102' height='126' src='adjunct!getImage?af.id=" + json.id + "' alt='上传照片' />";	
						// enable upload button
						this.enable();				
					}
				});
			}
						
			/**
			 * validation-engine 表单验证 
			 */
			jQuery(document).ready(function(){
                jQuery("#webForm").validationEngine({
                	validationEventTriggers:"keyup blur",  //触发的事件  validationEventTriggers:"keyup blur",   
                	inlineValidation: true,//是否即时验证，false为提交表单时验证,默认true   
                	success :  false,//为true时即使有不符合的也提交表单,false表示只有全部通过验证了才能提交表单,默认false   
                	promptPosition: "topRight"//提示所在的位置，topLeft, topRight, bottomLeft,  centerRight, bottomRight   
                	//failure : function() { alert("验证失败，请检查。");  }//验证失败时调用的函数   
                	//success : function() { callSuccessFunction() },//验证通过时调用的函数     
                });
			});
			
		</script>
		
	</head>
	<body style="margin-left: 23px;margin-right: 23px">
		<form class="form-style" action="Person!modify" method="post" id="webForm" name="webForm" enctype="multipart/form-data">
			<input type="hidden" name="object.id" id="" value="${object.id}"/>
			<input type="hidden" name="flag" id="" value="${flag}"/>
			<input type="hidden" name="funId" value="${funId}"/>
			<input type="hidden" name="page" value="${page}"/>
			<input type="hidden" name="object.organ.id" id="" value="${object.organ.id}"/>	
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>
						<!-- 位置 -->
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td height="44px" valign="bottom">
									当前位置：<a href="#">基础信息</a>-&gt;<font color="#ff0000">个人信息</font>
								</td>
							</tr>
						</table>
						<!-- 主表 -->
						<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 7px;">
							<tr>
								<td>
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td width="5" height="24" id="kjz03"></td>
											<td class="biao1_zhong">
												<table width="100%" border="0" cellspacing="0"	cellpadding="0">
													<tr>
														<td height="24" valign="middle" class="font_3">
															[个人信息]
														</td>
													</tr>
												</table>
											</td>
											<td width="5" height="24" id="kjy03"></td>
										</tr>
									</table>
								</td>
							</tr>
															
							<!-- 显示主体行 -->
							<tr>
								<td>
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td width="1" class="biao3_zuo"></td>
											<td>
												<table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td> 													
															<table width="100%" border="0" cellspacing="0" cellpadding="0" rules="groups">
																<tr>
																	<td width="20%" height="100%" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																			<tr>
																				<td align="right" valign="middle" class="font_1">
																					<s:text name="person.modify.name"></s:text>：
																				</td>																				
																			</tr>
																		</table>
																	</td>
																	<td width="30%" height="100%" class="biantiao_you">
																		<table width="77%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td align="left">
																					${object.name}
																				</td>																				
																			</tr>
																		</table>
																	</td>
																	
																	<td width="20%" height="805%" colspan="2" rowspan="9" align="center">
																		<table width="100%" border="0" cellspacing="5"
																			cellpadding="5">
																			<tr>
																				<td  align="center">
																					<div id="uploadPhoto" style="width: 102px;height:80%;border: 0px">
																						<s:if test="#request.object.photoFile == null" >
																							<img src="<at:url image="user_default.jpg"/>" width="102" height="126" alt="<s:text name="person.edit.uploadPhoto"></s:text>" />
																						</s:if>
																						<s:else>
																							<img src="Person!getImg?id=${object.id}" width="102" height="126" alt="<s:text name="person.edit.uploadPhoto"></s:text>" />
																						</s:else>
																					</div>
																				</td>
																				
																			</tr>
																		</table>
																	</td>																	
																</tr>
																
																<!-- 行分割线 -->
																<tr>
																	<td height="1" class="biaotiao_xia" colspan="2"></td>																	
																</tr>											
																
																<tr>
																	<td width="20%" height="100%" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																			<tr>
																				<td width="25%" align="right" valign="middle" class="font_1">
																					<nobr><s:text name="person.modify.sex"></s:text>：</nobr>
																				</td>																				
																			</tr>
																		</table>
																	</td>
																	<td width="30%" height="100%" class="biantiao_you">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td align="left">
																					${object.sex.name}																
																				</td>																				
																			</tr>
																		</table>
																	</td>																	
																</tr>  					
																<!-- 行分割线 -->
																<tr>
																	<td height="1" class="biaotiao_xia" colspan="2"></td>																	
																</tr>																
																<tr>																
																	 <td width="20%" height="100%" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																			<tr>
																				<td width="25%" align="right" valign="middle" class="font_1">
																					<nobr><s:text name="person.modify.cardId"></s:text>：</nobr>
																				</td>																				
																			</tr>
																		</table>
																	</td>
																	<td width="30%" height="100%" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="75%" align="left">
																					${object.cardId}
																				</td>																				
																			</tr>
																		</table>
																	</td>																															
																</tr>
																<!-- 行分割线 -->
																<tr>
																	<td height="1" class="biaotiao_xia" colspan="2"></td>																	
																</tr>	
																<tr>																
																	<td width="20%" height="100%" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																				<tr>
																					<td width="25%" align="right" class="font_1">
																						<nobr><s:text name="person.modify.nation"></s:text>：</nobr>
																					</td>																				
																				</tr>
																			</table>																		
																	</td>
																	<td width="30%" height="100%" class="biantiao_you">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="75%" align="left">
																					${object.nation.name}
																				</td>
																			</tr>
																		</table>
																	</td>
																	
																	
																</tr>
																
																<!-- 行分割线 -->
																<tr>
																	<td height="1" class="biaotiao_xia" colspan="2"></td>																	
																</tr>	
																<tr>	
																	<td width="20%" height="20" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																				<tr>
																					<td width="25%" align="right" class="font_1">
																						<nobr><s:text name="person.modify.nativePlace"></s:text>：</nobr>
																					</td>																				
																				</tr>
																			</table>																		
																	</td>
																	<td width="30%" height="20" class="biantiao_you">
																		<table width="75%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td align="left">
																					<input  type="text" id="natName" name="object.nativePlace.name" value="${object.nativePlace.name}" readonly="readonly"
																						 onclick="regSingleSelect('natId','natName');" style="width:100%"/> 
																						<input type="hidden" id="natId" name="object.nativePlace.id"/>
																				</td>																				
																			</tr>
																		</table>
																	</td>
																</tr>
																<!-- 行分割线 -->
																<tr>
																	<td height="1" class="biaotiao_xia" colspan="4"></td>																	
																</tr>	
																<tr>	
																	<td width="20%" height="25" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																				<tr>
																					<td width="25%" align="right" class="font_1">
																						<nobr><s:text name="person.modify.birthday"></s:text>：</nobr>
																					</td>																				
																				</tr>
																			</table>																		
																	</td>
																	<td width="30%" height="25" class="biantiao_you">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="75%" align="left">
																					${object.birthday}
																				</td>
																			</tr>
																		</table>
																	</td>																	
																	<td width="20%" height="25" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																			<tr>
																				<td width="25%" align="right" class="font_1">
																					<nobr>选择照片</nobr>
																				</td>																				
																			</tr>
																		</table>																		
																	</td>
																	<td width="30%" height="25">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="75%" align="left">
																					<nobr><input type="file" align="left"  name="phFile" id="phFile" style="width: 100%" /></nobr>
																				</td>
																			</tr>
																		</table>
																	</td>
																</tr>
																
																<!-- 行分割线 -->
																<tr>
																	<td height="1" class="biaotiao_xia" colspan="4"></td>																	
																</tr>	
																<tr>
																	<td width="20%" height="25" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																			<tr>
																				<td width="25%" align="right" class="font_1">
																					<nobr><s:text name="person.modify.school"></s:text>：</nobr>
																				</td>																				
																			</tr>
																		</table>																		
																	</td>
																	<td width="30%" height="25" class="biantiao_you">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="75%" align="left">
																					${object.school}
																				</td>
																			</tr>
																		</table>
																	</td>	
																	<td width="20%" height="25" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																			<tr>
																				<td width="25%" align="right" class="font_1">
																					<nobr><s:text name="person.modify.speciality"></s:text>：</nobr>
																				</td>																				
																			</tr>
																		</table>																		
																	</td>
																	<td width="30%" height="25">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="75%" align="left">
																					${object.speciality}
																				</td>
																			</tr>
																		</table>
																	</td>	
																</tr>																
																<!-- 行分割线 -->
																<tr>
																	<td height="1" class="biaotiao_xia" colspan="4"></td>																	
																</tr>	
																<tr>	
																	<td width="20%" height="25" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																			<tr>
																				<td width="25%" align="right" class="font_1">
																					<nobr><s:text name="person.modify.scholar"></s:text>：</nobr>
																				</td>																				
																			</tr>
																		</table>																		
																	</td>
																	<td width="30%" height="25" class="biantiao_you">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="80%" align="left">
																					${object.scholar.name}
																				</td>
																			</tr>
																		</table>
																	</td>
																	<td width="20%" height="25" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																			<tr>
																				<td width="25%" align="right" class="font_1">
																					<nobr><s:text name="person.modify.qualification"></s:text>：</nobr>
																				</td>																				
																			</tr>
																		</table>																		
																	</td>
																	<td width="30%" height="25">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="75%" align="left">
																					${object.jobTitle.name}
																				</td>
																			</tr>
																		</table>
																	</td>
																</tr>												
																																															
																<!-- 行分割线 -->
																<tr>
																	<td height="1" class="biaotiao_xia" colspan="4"></td>																	
																</tr>	
																<tr>	
																	<td width="20%" height="25" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																			<tr>
																				<td width="25%" align="right" class="font_1">
																					<nobr><s:text name="person.modify.duty"></s:text>：</nobr>
																				</td>																				
																			</tr>
																		</table>																		
																	</td>
																	<td width="30%" height="25" class="biantiao_you">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="75%" align="left">
																					${object.duty.name}
																				</td>
																			</tr>
																		</table>
																	</td>															
																	<td width="20%" height="10%" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																			<tr>
																				<td width="25%" align="right" class="font_1">
																					<nobr><s:text name="person.modify.professionalSkill"></s:text>：</nobr>
																				</td>																				
																			</tr>
																		</table>																		
																	</td>
																	<td width="30%" height="10%" colspan="3">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="75%" align="left" height="10%">
																						<input name="object.skill" value="${object.skill}"  style="width:100%"/>
																					</td>
																				</tr>
																			</table>
																		</td>																		
																	</tr>
																<!-- 行分割线 -->
																<tr>
																	<td height="1" class="biaotiao_xia" colspan="4"></td>																	
																</tr>	
																<tr>																
																	<td width="20%" height="10%" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																				<tr>
																					<td width="25%" align="right" class="font_1">
																						<nobr><s:text name="person.modify.mobile"></s:text>：</nobr>
																					</td>																				
																				</tr>
																			</table>																		
																	</td>
																	<td width="30%" height="10%" class="biantiao_you">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td align="left">
																					<input class="validate[custom[phone]]" type="text" id="personMobile" name="object.mobile" value="${object.mobile}"  style="width:100%"/>
																				</td>
																			</tr>
																		</table>
																	</td>
																	
																	<td width="20%" height="10%" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																				<tr>
																					<td width="25%" align="right" class="font_1">
																						<nobr><s:text name="person.modify.tel"></s:text>：</nobr>
																					</td>																				
																				</tr>
																			</table>																		
																	</td>
																	<td width="30%" height="10%">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																					<td width="75%" align="left">
																						<input class="validate[custom[phone]]" type="text" id="personTel" name="object.tel" value="${object.tel}"  style="width:100%"/>
																					</td>
																				</tr>
																			</table>
																		</td>		
																	</tr>
																<!-- 行分割线 -->
																<tr>
																	<td height="1" class="biaotiao_xia" colspan="4"></td>																	
																</tr>	
																<tr>																
																	<td width="20%" height="10%" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																				<tr>
																					<td width="25%" align="right" class="font_1">
																						<nobr><s:text name="person.modify.email"></s:text>：</nobr>
																					</td>																				
																				</tr>
																			</table>																		
																	</td>
																	<td width="30%" height="10%" class="biantiao_you">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="75%" align="left" height="10%">
																					<input class="validate[custom[email]]" type="text" id="personEmail" name="object.email" value="${object.email}" style="width:100%"/>
																				</td>
																			</tr>
																		</table>
																	</td>
																	
																	<td width="20%" height="10%" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																				<tr>
																					<td width="25%" align="right" class="font_1">
																						<nobr><s:text name="person.modify.addr"></s:text>：</nobr>
																					</td>																				
																				</tr>
																			</table>																		
																	</td>
																	<td width="30%" height="10%">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																					<td width="75%" align="left" height="10%">
																						<input type="text" name="object.addr" value="${object.addr}"  style="width:100%"/>
																					</td>
																				</tr>
																		</table>
																		</td>		
																	</tr>
																<!-- 行分割线 -->
																<tr>
																	<td height="1" class="biaotiao_xia" colspan="4"></td>																	
																</tr>	
																<tr>																
																	<td width="20%" height="102px" class="biantiao_you">
																		<table width="100%" border="0" cellspacing="5" cellpadding="5">
																				<tr>
																					<td width="25%" align="right" class="font_1">
																						<nobr><s:text name="person.modify.remark"></s:text>：</nobr>
																					</td>																				
																				</tr>
																			</table>																		
																	</td>
																	<td width="30%" height="102px" colspan="4">
																		<table width="73%" border="0" cellspacing="5" cellpadding="5">
																			<tr>																				
																				<td width="75%" align="left">
																						<textarea name="object.remark" rows="2" cols="50"  style="width:100%;height: 85px">${object.remark}</textarea>
																					</td>
																				</tr>
																			</table>
																		</td>
																	</tr>																	
															</table>															
														</td>
													</tr>
												</table>
											</td>
											<td width="1" class="biao3_you"></td>
										</tr>
									</table>
								</td>
							</tr>
							<!-- 按钮行 -->
							<tr>
								<td>
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td width="4" height="24" id="kj2z03"></td>
											<td class="biao3_xia">
												<table width="100%" border="0" cellspacing="0"
													cellpadding="0">
													<tr>
														<td height="24" class="biao4_zhong">
															<div id="nav_01">
																<ul>
																	<li>
																		<a href="#" onclick="update();">更新</a>
																	</li>  																 
																</ul>
															</div>
														</td>
													</tr>
												</table>
											</td>
											<td width="4" height="24" id="kj2y03"></td>
										</tr>
									</table>
								</td>
							</tr>
						</table>								
					</td>
				</tr>
			</table>		
		</form>
	</body>
</html>